<%--
 - Copyright (c) 2009-2011 ETCORE Labs. All rights reserved. 
 - 
 - This software is the confidential and proprietary information of ETCORE Labs. 
 - You shall not disclose such confidential information and shall use it only
 - in accordance with the terms of the license agreement you entered into
 - with ETCORE Labs.
 -
 - Support can be obtained from support forums at:
 - http://www.etcore.com/
 -
 - @author: ETCORE GroupTalk developers
 -
 --%>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://www.etcore.com/grouptalk" prefix="grouptalk"%>
<%@ taglib uri="http://jakarta.apache.org/taglibs/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<link rel="stylesheet" href="/group/css/styles.css" type="text/css">

</head>



<body bottomMargin=0 topMargin=0 leftmargin=10 rightmargin=10
	marginheight="0">
 
<TABLE cellSpacing=0 cellPadding=0 width=100% border=0 align=center>




	<tr>
		<td>
 
				<table cellSpacing=0 cellPadding=0 width=100%>
					<tr>
						<td width=100%  
							style=" border-bottom: 1px solid #d2d2d4;" nowrap>
					<div style="width: 100%; overflow: hidden;">
					<table style="table-layout: fixed;"><tr><td style="font-size: 9px;  color: #808080;">	
					<a href="/group/community${context.postfix }" style="font-size: 13px;  color: #808080;"><b><c:out
							value="${context.platform2 }" /></b></a>&nbsp;
					<c:forEach var="group" items="${rootGroups2}"> | 
					<c:if
						test="${!context.encryptedUrl2}">
						<a style="color:#808080;font-size:12px;"
							href="/group/communityView<c:out value='${context.postfix}'/>?gid=<c:out value='${group.id }'/>"><c:out
							value='${group.name }' /></a>
					</c:if> <c:if test="${context.encryptedUrl1}">
						<c:set var='urlFragmentStr' value='?gid=${group.id}' />
						<c:set var='urlFragment'
							value='${grouptalk:getEncryptedStr(urlFragmentStr)}' />
						<a style="color:#808080;font-size:12px;"
							href="/group/communityView<c:out value='${context.postfix }'/>/~<c:out value='${urlFragment}'/>"><c:out
							value='${group.name }' /></a>&nbsp;
					</c:if>
					</c:forEach>		
						<c:forEach var="directory" items="${directories2}">
						<c:set var="groups" value="${directory.id }groups" />
						<c:forEach var="group" items="${requestScope[groups]}"> |						
						<c:if test="${!context.encryptedUrl2}">
									<a style="color:#808080;font-size:12px;"
										href="/group/communityView<c:out value='${context.postfix}'/>?gid=<c:out value='${group.id }'/>"><c:out
										value='${group.name }' /></a>
								</c:if> <c:if test="${context.encryptedUrl2}">
									<c:set var='urlFragmentStr' value='?gid=${group.id}' />
									<c:set var='urlFragment'
										value='${grouptalk:getEncryptedStr(urlFragmentStr)}' />
									<a  style="color:#808080;font-size:12px;"
										href="/group/communityView<c:out value='${context.postfix }'/>/~<c:out value='${urlFragment}'/>"><c:out
										value='${group.name }' /></a>
								</c:if>
						</c:forEach>
						
						</c:forEach>	
					</td></tr></table>
					</div>	
					 </td>
					</tr>
					<tr>

						<td valign=top width=100%>
						<table width=100% style="margin-top: 3px;">




							<tr>
								<td>
								<TABLE width=100% cellSpacing=10 cellPadding=0 align=left>

									<c:set var="seq" value="-1" />
									<c:forEach var="group" items="${activeCommunityGroups}">
										<c:set var="seq" value="${seq+1}" />
										<c:if test="${seq %2==0 }">
											<tr>
										</c:if>
										<td width=50%>
										<table>
											<tr>
												<td width=130 valign=top align=center><c:if
													test="${!context.encryptedUrl2}">
													<a
														<c:if test="${not empty param.target}"> target=_top </c:if>
														href="/group/communityView<c:out value='${context.postfix }'/>?gid=<c:out value='${group.id }'/>"><c:if
														test="${not empty group.pic &&fn:indexOf(group.pic,'upload')!=-1 }">
														<img src="/<c:out value='${group.pic}' />" width="130"
															height=160 style="border: 1px solid #b4d2d4;">
													</c:if><c:if
														test="${empty group.pic ||fn:indexOf(group.pic,'upload')==-1 }">
														<img src="/group/images/avatar/group.jpg" width="130"
															height=160 style="border: 1px solid #b4d2d4;">
													</c:if></a>
												</c:if> <c:if test="${context.encryptedUrl2}">
													<c:set var='urlFragmentStr' value='?gid${group.id}' />
													<c:set var='urlFragment'
														value='${grouptalk:getEncryptedStr(urlFragmentStr)}' />
													<a
														<c:if test="${not empty param.target}"> target=_top </c:if>
														href="/group/communityView<c:out value='${context.postfix }'/>/~<c:out value='${urlFragment}'/>"><c:if
														test="${not empty group.pic &&fn:indexOf(group.pic,'upload')!=-1 }">
														<img src="/<c:out value='${group.pic}' />" width="130"
															height=160 style="border: 1px solid #b4d2d4;">
													</c:if><c:if
														test="${empty group.pic ||fn:indexOf(group.pic,'upload')==-1 }">
														<img src="/group/images/avatar/group.jpg" width="130"
															height=160 style="border: 1px solid #b4d2d4;">
													</c:if></a>
												</c:if></td>
												<td width=100% valign=top>
												<div style="width: 100%; overflow: hidden">
												<table style="table-layout: fixed; background: #ffffff"
													cellspacing=3 cellpadding=0 width=100%>
													<tr>
														<td style="white-space:nowrap;"><c:if test="${!context.encryptedUrl2}">
															<a
																<c:if test="${not empty param.target}"> target=_top </c:if>
																href="/group/communityView<c:out value='${context.postfix }'/>?gid=<c:out value='${group.id }'/>"><b><c:out
																value='${group.name }' /></b></a>
														</c:if> <c:if test="${context.encryptedUrl2}">
															<c:set var='urlFragmentStr' value='?gid${group.id}' />
															<c:set var='urlFragment'
																value='${grouptalk:getEncryptedStr(urlFragmentStr)}' />
															<a
																<c:if test="${not empty param.target}"> target=_top </c:if>
																href="/group/communityView<c:out value='${context.postfix }'/>/~<c:out value='${urlFragment}'/>"><b><c:out
																value='${group.name }' /></b></a>
														</c:if>
														<c:set var="groupMsgCount" value="${group.id}groupMsgCount" />
										<c:set var="groupCommentCount" value="${group.id}groupCommentCount" />
										<font style="font-size:11px" color=#999999>${context.text_subject}:${requestScope[groupMsgCount]}，${context.text_comment}:${requestScope[groupCommentCount]}</font>
														
														</td>

														<td align=center width=80><c:if
															test="${empty session_user}">
															<input type=button
																style="border: 0px; cursor: pointer; height: 20px; width: 70px; background: #36518B; font-size: 12px; color: #ffffff"
																value="${context.focus }" onclick="showLoginWin();" />
														</c:if> <c:set var="currentIncluded" value="included${group.id}" />
														<c:if
															test='${(not empty session_user)&&  !(requestScope[currentIncluded])}'>
															<input type=button
																style="border: 0px; cursor: pointer; height: 20px; width: 70px; background: #36518B; font-size: 12px; color: #ffffff"
																value="${context.focus }"
																onclick="window.location.href='/group/communityView${context.postfix }?cmd=addFocus&gid=${group.id}'" />

														</c:if><c:if
															test='${(not empty session_user)&& (requestScope[currentIncluded]) }'>
															<input type=button
																style="border: 0px; cursor: pointer; height: 20px; width: 70px; background: #e8e8e8; font-size: 12px; color: blue"
																value="${context.cancel_focus }"
																onclick="window.location.href='/group/communityView${context.postfix }?cmd=delFocus&gid=${group.id}'" />

														</c:if></td>


													</tr><c:if test="${group.func==1 }">
														<tr bgcolor="#ffffff">
																<td width=100% nowrap colspan=2  >
															<img src="/group/images/locked.jpg"  ></td></tr>
														</c:if>
														<c:if test="${group.func==0 }">
													<tr bgcolor="#ffffff">
														<td width=100% nowrap colspan=2>
														<div style="overflow-x: hidden;"><c:set
															var="topicsKey" value="${group.id}topics" /><c:forEach
															var="topic" items="${requestScope[topicsKey]}">
															<c:if test="${!context.encryptedUrl2}">
																<a style="color:#808080"
																	<c:if test="${not empty param.target}"> target=_top </c:if>
																	href="/group/communityView<c:out value='${context.postfix }'/>?tid=<c:out value='${topic.id}'/>&gid=<c:out value='${group.id}'/>"><c:out
																	value='${topic.name}' /></a>
															</c:if>
															<c:if test="${context.encryptedUrl2}">
																<c:set var='urlFragmentStr'
																	value='?gid=${group.id}&tid=${topic.id}' />
																<c:set var='urlFragment'
																	value='${grouptalk:getEncryptedStr(urlFragmentStr)}' />
																<a style="color:#808080"
																	<c:if test="${not empty param.target}"> target=_top </c:if>
																	href="/group/communityView<c:out value='${context.postfix }'/>/~<c:out value='${urlFragment}'/>"><c:out
																	value='${topic.name }' /></a>
															</c:if>&nbsp;
						</c:forEach></div>
														</td>

													</tr>
													<c:set var="rowCount" value="0" />
													<c:set var="msgKey" value="${group.id}msgs" />
													<c:forEach var="msg" items="${requestScope[msgKey]}">


														<tr>
															<td width=100% align=center colspan=2>

															<table cellpadding=0 cellspacing=0 width=100%>
																<tr>
																	<td nowrap><c:if test="${!context.encryptedUrl2}">
																		<a
																			<c:if test="${not empty param.target}"> target=_top </c:if>
																			href="/group/communityView<c:out value='${context.postfix }'/>?gid=<c:out value='${group.id }'/>&tid=<c:out value='${msg[1]}'/>">
																		[<c:out value='${topicMap[msg[1]]}' />]</a>
																	</c:if> <c:if test="${context.encryptedUrl2}">

																		<c:set var='urlFragmentStr'
																			value='?gid=${group.id}&tid=${ msg[1]}' />
																		<c:set var='urlFragment'
																			value='${grouptalk:getEncryptedStr(urlFragmentStr)}' />
																		<a
																			<c:if test="${not empty param.target}"> target=_top </c:if>
																			href="/group/communityView<c:out value='${context.postfix }'/>/~<c:out value='${urlFragment}'/>">
																		[<c:out value='${topicMap[msg[1]]}' />]</a>
																	</c:if></td>
																	<td width=100% nowrap>
																	<div style="width: 100%; overflow: hidden;"><c:if
																		test="${!(context.encryptedUrl2)}">

																		<a
																			<c:if test="${not empty param.target}"> target=_top </c:if>
																			<c:if test="${msg[7] >0 }">style="color:red;"</c:if>
																			href="/group/messagedetail<c:out value='${context.postfix }'/>?id=<c:out value='${msg[0] }'/>"
																			target=_blank><c:out value='${msg[2] }' /></a>
																	</c:if> <c:if test="${context.encryptedUrl2}">
																		<c:set var='urlFragmentStr' value='?id=${msg[0]}' />
																		<c:set var='urlFragment'
																			value='${grouptalk:getEncryptedStr(urlFragmentStr)}' />
																		<a
																			<c:if test="${msg[7] >0 }">style="color:red;" </c:if>
																			<c:if test="${not empty param.target}"> target=_top </c:if>
																			href="/group/messagedetail<c:out value='${context.postfix }'/>/~<c:out value='${urlFragment}'/>">
																		<c:out value='${msg[2] }' /></a>
																	</c:if></div>
																	</td>
																</tr>
															</table>
															</td>
														</tr>
														<c:set var="rowCount" value="${rowCount+1 }" />
													</c:forEach>
													<c:forEach begin="${rowCount+1 }" end="5" step="1">
														<tr>
															<td></td>
														</tr>
													</c:forEach>
</c:if>
												</table>
												</div>
												</td>
											</tr>
										</table>
										</td>

										<c:if test="${seq%2==1 }">
											</tr>
										</c:if>
									</c:forEach>
									<c:if test="${seq%2==0 }">
										<td></td>
										</tr>
									</c:if>
								</table>
								</td>
							</tr>



						</table>
						</td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
 
</body>
</html>

